/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package binh;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author trungdv2
 */
public class CApp
{

    private int AppId;
    private CAppMgr NetContainer;
    private List<CChannel> ChannelList = new ArrayList<>();

    public CApp(CAppMgr GameList, int AppId)
    {
        this.AppId = AppId;
        this.NetContainer = GameList;
    }

    public int GetNumClient()
    {
        int Num = 0;
        for (CChannel Channel : ChannelList)
        {
            Num += Channel.GetNumClient();
        }
        return Num;
    }

    public CAppMgr GetNetContainer()
    {
        return NetContainer;
    }

    public int GetMaxChannel()
    {
        return ChannelList.size();
    }

    public void AddChannel(CChannel Channel)
    {
        ChannelList.add(Channel);
    }

    public CChannel GetChannelByIndex(int index)
    {
        return ChannelList.get(index);
    }

    public int GetAppID()
    {
        return AppId;
    }
}
